<?php

    if(is_array($result))
	{
		header('Content-Type: application/json; Charset=UTF-8',true);
		$jsonData = array('page'=>$proveedorFN->page,'total'=>$proveedorFN->numeroRegistros,'rows'=>array());
		foreach ($result as $key => $obj)
		{
		//If cell's elements have named keys, they must match column names
		//Only cell's with named keys and matching columns are order independent.
			$entry = array('id'=>$obj->getProveedorId(),
			    'cell'=>array(
			    
			            'proveedorId' =>$obj->getProveedorId(),
			            'nombre'=>utf8_encode($obj->getNombre()),			           
			            'opciones'=>"                               
                               <img border='0' title='Editar Proveedor' src='/gourmet-express/trunk/imgs/icons/page_edit.png' onclick=fn_editar('". $obj->getProveedorId()."') style='cursor:pointer;'>
                               "
			    ),
			);
			$jsonData['rows'][] = $entry;
		}
		echo json_encode($jsonData);
	}?>
